//
//  JSWTViewController.m
//  Hxcsfw
//
//  Created by qiysoft on 2017/12/27.
//  Copyright © 2017年 企友软mac. All rights reserved.
//

#import "JSWTViewController.h"
#import "CouseSeachListView.h"
#import "AnswerSortListViewController.h"

@interface JSWTViewController ()<CouseSeachListViewDelegate>
{
    CouseSeachListView *seachView;
    int m;
    int n;
}
@property (nonatomic,copy) NSString *level1;
@property (nonatomic,copy) NSString *level2;
@property (nonatomic,copy) NSString *level3;
@property (nonatomic,strong) NSArray *JSWTArray;

@end

@implementation JSWTViewController
-(void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    
    _JSWTArray = @[@{@"children":@[@{@"level3":@"zcdl",@"value":@"注册登录"},@{@"level3":@"bbtb",@"value":@"报表填报"},@{@"level3":@"sbhz",@"value":@"申报回执"},@{@"level3":@"bbdy",@"value":@"报表打印"},@{@"level3":@"skjn",@"value":@"税款缴纳"},@{@"level3":@"ppdk",@"value":@"普票代开"},@{@"level3":@"zpdk",@"value":@"专票代开"},@{@"level3":@"wgsq",@"value":@"外管申请"},@{@"level3":@"fplg",@"value":@"发票领购"},@{@"level3":@"wssbqt",@"value":@"其他"}],@"level2":@"sb",@"value":@"网上服务平台"},
                   
                   @{@"children":@[@{@"level3":@"azsj",@"value":@"安装升级"},@{@"level3":@"zcdl",@"value":@"注册登录"},@{@"level3":@"bbtb",@"value":@"报表填报"},@{@"level3":@"ckhz",@"value":@"查看回执"},@{@"level3":@"bbdy",@"value":@"报表打印"},@{@"level3":@"skjn",@"value":@"税款缴纳"},@{@"level3":@"wssbkhdqt",@"value":@"其他"}],@"level2":@"wssbkhd",@"value":@"服务平台客户端"},
                   
//                   @{@"children":@[@{@"level3":@"azsj",@"value":@"安装升级"},@{@"level3":@"zcdl",@"value":@"注册登录"},@{@"level3":@"tbdy",@"value":@"报表填报"},@{@"level3":@"hztx",@"value":@"申报回执"},@{@"level3":@"bbdy",@"value":@"报表打印"},@{@"level3":@"wsjs",@"value":@"网上缴税"},@{@"level3":@"lxsbqt",@"value":@"其他"}],@"level2":@"lx",@"value":@"电子申报"},

                   @{@"children":@[@{@"level3":@"azsz",@"value":@"安装设置"},@{@"level3":@"dlxd",@"value":@"登录向导"},@{@"level3":@"fpkj",@"value":@"开具发票"},@{@"level3":@"fphc",@"value":@"发票红冲"},@{@"level3":@"csqk",@"value":@"抄税清卡"},@{@"level3":@"hzmx",@"value":@"汇总明细打印"},@{@"level3":@"skkpqt",@"value":@"其他"}],@"level2":@"kp",@"value":@"税控开票"},
                   
                   @{@"children":@[@{@"level3":@"azgl",@"value":@"安装登录"},@{@"level3":@"fpsm",@"value":@"发票扫描"},@{@"level3":@"cxdy",@"value":@"查询打印"},@{@"level3":@"rzqt",@"value":@"其他"}],@"level2":@"rz",@"value":@"网上认证"},
                   
                   @{@"children":@[@{@"level3":@"dlsz",@"value":@"登录设置"},@{@"level3":@"dktjdy",@"value":@"抵扣统计打印"},@{@"level3":@"gxqr",@"value":@"勾选确认"},@{@"level3":@"xzqrqt",@"value":@"其他"}],@"level2":@"xzqr",@"value":@"发票选择确认"},
                   
                   @{@"children":@[@{@"level3":@"dyjcjgz",@"value":@"打印机故障"},@{@"level3":@"dncjgz",@"value":@"电脑故障"},@{@"level3":@"dnqt",@"value":@"其他"}],@"level2":@"dn",@"value":@"电脑打印机"}];
    
    [WShareUtil sharedData].arrList = _JSWTArray;
    
    // 在这里修改“问题分类的高度”
    if (seachView == nil) {
        
        if (XIPHONE) {
            seachView = [[CouseSeachListView alloc]initWithFrame:CGRectMake(0, 0, WSCREENH_WIDTH, WSCREENH_HEIGHT - 49 - 64 - 50)];//24是比其他机型高出的导航栏部分
        }else{
            seachView = [[CouseSeachListView alloc]initWithFrame:CGRectMake(0, 0, WSCREENH_WIDTH, WSCREENH_HEIGHT - 49 - 64)];
        }
        
        seachView.delegate = self;
        [self.view addSubview:seachView];
    }
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)btnOfpassValueClicked:(UIButton *)sender {
    
    _level1 = @"tech";
    WLog(@"%ld",(long)sender.tag);
    
    NSString *tagStr = [NSString stringWithFormat:@"%ld",(long)sender.tag];
    m = [[tagStr substringToIndex:1] intValue] - 1;
    n = [[tagStr substringFromIndex:tagStr.length-1] intValue];
    
    WLog(@"十位-%d",m);
    WLog(@"个位-%d",n);

    _level2 = [_JSWTArray[m] objectForKey:@"level2"];
    NSArray *arr = [_JSWTArray[m] objectForKey:@"children"];
    _level3 = [arr[n] objectForKey:@"level3"];
//    _level3 = [[[WShareUtil sharedData].arrList[0] objectForKey:@"children"][0] objectForKey:@"level3"];
    
    WLog(@"_level1-%@",_level1);
    WLog(@"_level2-%@",_level2);
    WLog(@"_level3-%@",_level3);
    
    AnswerSortListViewController *aslVC = [[AnswerSortListViewController alloc]init];
    aslVC.level1 = _level1;
    aslVC.level2 = _level2;
    aslVC.level3 = _level3;
    aslVC.navTitle = [arr[n] objectForKey:@"value"];

    [self.navigationController pushViewController:aslVC animated:YES];
}

//点击隐藏list搜索
- (void)btnOfDisappearClicked {
}

@end
